package com.hdoit.apollo.web.shop.modelconfig;

import com.hdoit.apollo.web.shop.providers.CustomerProvider;
import com.hdoit.apollo.web.shop.providers.PaymentStateProvider;
import com.hdoit.apollo.web.shop.providers.PaymentTypeProvider;
import com.hdoit.apollo.web.shop.providers.SupplierProvider;
import com.tennetcn.web.component.attribute.DisplayNameAttribute;
import com.tennetcn.web.component.attribute.DropDownListAttribute;
import com.tennetcn.web.component.attribute.RequiredAttribute;
import com.tennetcn.web.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
 * @author      tancongzhu
 * @email       
 * @createtime  2018年06月01日 10:41:32
 * @comment
 */
public class PaymentConfig extends ModelMetadataAttributeConfiguration{
    public PaymentConfig(){
    	
        this.setProperty("amount")
            .hasAttribute(new DisplayNameAttribute("付款金额"))
            .hasAttribute(new RequiredAttribute("必填"));
        
        this.setProperty("haveAmount")
	        .hasAttribute(new DisplayNameAttribute("已付金额"));

        this.setProperty("type")
            .hasAttribute(new DisplayNameAttribute("方式"))
	        .hasAttribute(new RequiredAttribute("必填"))
	    	.hasAttribute(new DropDownListAttribute(new PaymentTypeProvider()));

        this.setProperty("paymentState")
	        .hasAttribute(new DisplayNameAttribute("类型"))
	        .hasAttribute(new RequiredAttribute("必填"))
	    	.hasAttribute(new DropDownListAttribute(new PaymentStateProvider()));
        
        this.setProperty("shopId")
            .hasAttribute(new DisplayNameAttribute("门店id"));

        this.setProperty("comment")
            .hasAttribute(new DisplayNameAttribute("备注"));
        
        this.setProperty("billing.billingMoney")
        	.hasAttribute(new DisplayNameAttribute("订单总额(元)"));
        
        this.setProperty("billing.paidAmount")
        	.hasAttribute(new DisplayNameAttribute("已付金额"));

	    this.setProperty("billing.unpaidAmount")
	        .hasAttribute(new DisplayNameAttribute("待支付"));
	    
        this.setProperty("billing.billingNo")
        	.hasAttribute(new DisplayNameAttribute("订单号"));
        
        this.setProperty("customerId")
	        .hasAttribute(new DisplayNameAttribute("客户"))
	    	.hasAttribute(new DropDownListAttribute(new CustomerProvider()))
	    	.hasAttribute(new RequiredAttribute("必填"));
        this.setProperty("supplierId")
	        .hasAttribute(new DisplayNameAttribute("供应商"))
	    	.hasAttribute(new DropDownListAttribute(new SupplierProvider()))
	    	.hasAttribute(new RequiredAttribute("必填"));
    }
       
}
